/**
 * 替换模板字符串参数
 * @param {string} text
 * @param {string[]} params
 * @return {string}
 */
export function replaceTemplateText(text: string, ...params: string[]) {
  let newText = text;
  const matchData = text.match(/{\d?}/g);
  matchData &&
    matchData.forEach((key, index) => {
      params[index] && (newText = newText.replace(key, params[index]));
    });
  return newText;
}
